tools/ocaml/xb: Drop Xs_ring.write
authorEdwin Török <edvin.torok@citrix.com>
Fri, 16 Dec 2022 18:25:20 +0000 (18:25 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Thu, 9 Feb 2023 15:55:25 +0000 (15:55 +0000)
commitf0e653fb4aea77210b8096c170e82de3c2039d89
tree88b9e8b0f123ce234503d3b2ce265152ac93f856
parent7d516fc87637dc551494f8eca08f106f578f7112
tools/ocaml/xb: Drop Xs_ring.write

This function is unusued (only Xs_ring.write_substring is used), and the
bytes/string conversion here is backwards: the C stub implements the bytes
version and then we use a Bytes.unsafe_of_string to convert a string into
bytes.

However the operation here really is read-only: we read from the string and
write it to the ring, so the C stub should implement the read-only string
version, and if needed we could use Bytes.unsafe_to_string to be able to send
'bytes'. However that is not necessary as the 'bytes' version is dropped above.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Acked-by: Christian Lindig <christian.lindig@citrix.com>
(cherry picked from commit 01f139215e678c2dc7d4bb3f9f2777069bb1b091)
tools/ocaml/libs/xb/xs_ring.ml
tools/ocaml/libs/xb/xs_ring_stubs.c